#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
#include<limits.h>

int my_atoi(char* p)
{
	char* start = p;
	long long count = 0;
	int sz = 0;
	int flag = 1;
	while (*start == ' ')
	{
		start++;
	}

	if (*start == '+')
	{
		flag = 1;
		start++;
	}
	else if (*start == '-')
	{
		flag = -1;
		start++;
	}
	else
	{
		flag = 1;
	}

	while (*start >= 48 && *start <= 57 )
	{
		count = count * 10 + flag * (*start - '0');
		start++;
	}
	if (count > INT_MAX)
		count = INT_MAX;
	if (count < INT_MIN)
		count = INT_MIN;
	return count;
}

int main()
{
	int len = my_atoi("-91283472332");
	printf("%d",len);
	return 0;
}

